From f3a1bad634502f2f4fad13e9f4d5de16aa8a1d31 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Sun, 26 Mar 2006 11:45:35 +0100 Subject: [PATCH] Allow 64-bit Xen to run 64-bit hvm SMP guests. Signed-off-by: Jun Nakajima --- xen/arch/x86/shadow.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/shadow.c b/xen/arch/x86/shadow.c index 1f312a4fdb..8eacde9735 100644 --- a/xen/arch/x86/shadow.c +++ b/xen/arch/x86/shadow.c @@ -1807,6 +1807,16 @@ static int resync_all(struct domain *d, u32 stype) entry_has_changed( guest_pt[i], snapshot_pt[i], PAGE_FLAG_MASK) ) { + + unsigned long gpfn; + + gpfn = entry_get_pfn(guest_pt[i]); + /* + * Looks like it's longer a page table. + */ + if ( unlikely(gpfn != (gpfn & PGT_mfn_mask)) ) + continue; + need_flush |= validate_entry_change( d, &guest_pt[i], &shadow_pt[i], shadow_type_to_level(stype)); @@ -1851,6 +1861,14 @@ static int resync_all(struct domain *d, u32 stype) { #ifndef GUEST_PGENTRY_32 l4_pgentry_t *shadow4 = shadow; + unsigned long gpfn; + + gpfn = l4e_get_pfn(new_root_e); + /* + * Looks like it's longer a page table. + */ + if ( unlikely(gpfn != (gpfn & PGT_mfn_mask)) ) + continue; if ( d->arch.ops->guest_paging_levels == PAGING_L4 ) { @@ -1894,7 +1912,7 @@ static int resync_all(struct domain *d, u32 stype) unmap_domain_page(snapshot); unmap_domain_page(guest); - if ( unlikely(unshadow) ) + if ( unlikely(unshadow && stype == PGT_root_page_table) ) { for_each_vcpu(d, v) if(smfn == pagetable_get_pfn(v->arch.shadow_table)) -- 2.30.2